
#ifndef __VERTEX4D_H__
#define __VERTEX4D_H__

#include "Vector.h"


// defines for vertices, these are "hints" to the transform and
// lighting systems to help determine if a particular vertex has
// a valid normal that must be rotated, or a texture coordinate
// that must be clipped etc., this helps us minmize load during lighting
// and rendering since we can determine exactly what kind of vertex we
// are dealing with, something like a (direct3d) flexible vertex format in 
// as much as it can hold:
// point
// point + normal
// point + normal + texture coordinates
#define VERTEX4DTV1_ATTR_NULL             0x0000 // this vertex is empty
#define VERTEX4DTV1_ATTR_POINT            0x0001
#define VERTEX4DTV1_ATTR_NORMAL           0x0002
#define VERTEX4DTV1_ATTR_TEXTURE          0x0004



// 4D homogeneous vertex with 2 texture coordinates, and vertex normal ////////////////
// normal can be interpreted as vector or point
typedef struct VERTEX4DTV1_TYP
{
	union
	{
		float M[12];            // array indexed storage

		// explicit names
		struct
		{
			float x,y,z,w;     // point
			float nx,ny,nz,nw; // normal (vector or point)
			float u0,v0;       // texture coordinates 

			float i;           // final vertex intensity after lighting
			int   attr;        // attributes/ extra texture coordinates
		};                 // end struct

		// high level types
		struct 
		{
			CPoint4d  v;       // the vertex
			CVector4d n;       // the normal
			CPoint2d  t;       // texture coordinates
		};

	}; // end union

} VERTEX4DTV1, *VERTEX4DTV1_PTR;


class CVertex4d : public VERTEX4DTV1
{
public:

	CVertex4d()
	{
		
	}

	~CVertex4d()
	{

	}

	int Scale(CVector4d& scale)
	{
		v.Scale(scale);

		return 0;
	}

protected:

};

#endif